package cn.szabadsag.hrm.client;

import cn.szabadsag.hrm.doc.CourseDoc;
import cn.szabadsag.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author yangcong
 * @date 2022年04月11日 9:44
 * @since
 */
@FeignClient(value = "hrm-search",fallbackFactory = SearchServiceClientFallbackFactory.class)
public interface SearchServiceClient {

    //  课程上线  同步到ES
    @PostMapping("/course/add")
    AjaxResult add(@RequestBody CourseDoc doc);

    //  课程下线  从ES中删除
    @DeleteMapping("/course/delete/{id}")
    AjaxResult delete(@PathVariable Long id);

}
